package com.qqt.csr.order.service.statemachine.context;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.qqt.csr.order.entity.WorkOrder;
import com.qqt.csr.order.enums.WorkOrderEventEnum;
import com.qqt.csr.order.enums.WorkOrderStatusEnum;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.util.Map;

/**
 * @author
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Builder
@Accessors(chain = true)
@JsonIgnoreProperties(ignoreUnknown = true)
public class WorkOrderContext implements Serializable {
    @Serial
    private static final long serialVersionUID = -4446541060264972874L;

    /**
     * 租户id
     */
    private String tenantId;

    /**
     * 原工单数据
     */
    private WorkOrder fromOrder;

    /**
     * 当前工单数据
     */
    private WorkOrder toOrder;

    /**
     * 事件
     */
    private WorkOrderEventEnum event;

    /**
     * 事件扩展数据
     */
    private Map<String, Object> eventExt;

    /**
     * 工单原状态
     */
    private WorkOrderStatusEnum fromStatus;

    /**
     * 上下文扩展数据
     */
    private Map<String, Object> ext;

    /**
     * 操作人id
     */
    private Long operatorId;

    /**
     * 操作人名称
     */
    private String operatorName;

}
